package com.cj.webapp.account.dao;

import com.cj.webapp.account.pojo.ProHangDto;
import com.cj.webapp.common.utils.MybatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;

/**
 * Created by dell on 2017/12/25.
 */
public class HangDao {
    private SqlSessionFactory sessionFactory = MybatisUtil.getInstance();
    //创建能执行映射文件中sql的sqlSession
    SqlSession session = sessionFactory.openSession();
    HangMapper hangMapper = session.getMapper(HangMapper.class);

    public List<ProHangDto> getProHangByHangId(String id){
        List<ProHangDto> list=null;
        try {
            list=hangMapper.getProHangByHangId(id);
        }catch (Exception e){
            e.printStackTrace();
        }
        return  list;
    }
    public  ProHangDto getProHang(){
    	ProHangDto proHangDto=null;
    	try {
			proHangDto =hangMapper.getProHang();
		} catch (Exception e) {
			e.printStackTrace();
		}
    	return proHangDto;
    }
    
}
